<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>


<script type="text/javascript">
	//
	function createTea(name) {
		// 白面 创建一个空白对象 ----原材料

		let obj = {}

		//添加属性和方法---加工
		obj.name = name
		obj.getName = function() {
			console.log(this.name + 
				'drink tea')
		}
		//出场
		return obj
	}

	let obj1 = createTea('孙悟空')
	obj1.getName()

	let obj2 = createTea('唐僧')
</script>
</body>
</html>